Skip to content

Add ConversationEventMap and event-name mapping - #743

Draft
kraenhansen wants to merge 1 commit into
kh/event-emitter-codegenfrom
kh/event-emitter-event-map
Draft

Add ConversationEventMap and event-name mapping#743
kraenhansen wants to merge 1 commit into
kh/event-emitter-codegenfrom
kh/event-emitter-event-map

Conversation

@kraenhansen

@kraenhansen kraenhansen commented May 7, 2026

Copy link
Copy Markdown
Member

Summary

  • Create packages/client/src/events.ts combining generated events (GeneratedEventMap) with hand-written internal and extra events into a unified ConversationEventMap
  • Move Callbacks, CALLBACK_KEYS from types.ts to events.ts and add CALLBACK_KEY_TO_EVENT_NAME mapping table
  • Override vad-score in ConversationEventMap for backward-compatible { vadScore } payload shape
  • Export ConversationEventMap from the client package

Part of #738 (PR 3/6).

Test plan

  • pnpm turbo build check-types lint passes for all packages (30/30 tasks)
  • Downstream packages (@elevenlabs/react, @elevenlabs/react-native, widget packages) build successfully
  • No import cycle introduced (client → types for generated types only)

🤖 Generated with Claude Code


Note

Low Risk
Primarily TypeScript type/export reshaping with a new mapping constant; runtime behavior is largely unchanged aside from consumers relying on old import locations.

Overview
Introduces a new events.ts module that defines a unified ConversationEventMap by combining generated wire events with internal/extra conversation events, including a backward-compatible override for the vad-score payload shape.

Moves Callbacks and CALLBACK_KEYS out of types.ts into events.ts, and adds a CALLBACK_KEY_TO_EVENT_NAME table to map callback property names (e.g. onMCPToolCall) to their corresponding emitted event names.

Updates exports so BaseConversation/package index.ts now re-export Callbacks, CALLBACK_KEYS, and the new ConversationEventMap from events.ts, and trims types.ts to core shared types only.

Reviewed by Cursor Bugbot for commit b5b5b87. Bugbot is set up for automated code reviews on this repo. Configure here.

Move Callbacks and CALLBACK_KEYS from types.ts to a new events.ts module
that combines generated events with hand-written internal and extra events
into a unified ConversationEventMap. Add CALLBACK_KEY_TO_EVENT_NAME mapping
for wiring callbacks to event names.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant